package com.firebird.oms.domain.sm;

// Generated 2009-11-20 18:24:23 by Hibernate Tools 3.2.5.Beta

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/**
 * TismOperLog generated by hbm2java
 */
@Entity
@Table(name = "tism_oper_log")
public class TismOperLog implements java.io.Serializable {

	private static final long serialVersionUID = 8930608849867304164L;
	private Integer id;
	private int loginId;
	private String loginIp;
	private String macAddr;
	private Date operTime;
	private String operDesc;
	private int action;
	private String operTabName;
	private String operBeforeValue;
	private String operAfterValue;

	public TismOperLog() {
	}

	public TismOperLog(int loginId, String loginIp, Date operTime, int action) {
		this.loginId = loginId;
		this.loginIp = loginIp;
		this.operTime = operTime;
		this.action = action;
	}

	public TismOperLog(int loginId, String loginIp, String macAddr,
			Date operTime, String operDesc, int action, String operTabName,
			String operBeforeValue, String operAfterValue) {
		this.loginId = loginId;
		this.loginIp = loginIp;
		this.macAddr = macAddr;
		this.operTime = operTime;
		this.operDesc = operDesc;
		this.action = action;
		this.operTabName = operTabName;
		this.operBeforeValue = operBeforeValue;
		this.operAfterValue = operAfterValue;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "login_id", nullable = false)
	public int getLoginId() {
		return this.loginId;
	}

	public void setLoginId(int loginId) {
		this.loginId = loginId;
	}

	@Column(name = "login_ip", nullable = false, length = 48)
	public String getLoginIp() {
		return this.loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}

	@Column(name = "mac_addr", length = 48)
	public String getMacAddr() {
		return this.macAddr;
	}

	public void setMacAddr(String macAddr) {
		this.macAddr = macAddr;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "oper_time", nullable = false, length = 0)
	public Date getOperTime() {
		return this.operTime;
	}

	public void setOperTime(Date operTime) {
		this.operTime = operTime;
	}

	@Column(name = "oper_desc", length = 254)
	public String getOperDesc() {
		return this.operDesc;
	}

	public void setOperDesc(String operDesc) {
		this.operDesc = operDesc;
	}

	@Column(name = "action", nullable = false)
	public int getAction() {
		return this.action;
	}

	public void setAction(int action) {
		this.action = action;
	}

	@Column(name = "oper_tab_name", length = 64)
	public String getOperTabName() {
		return this.operTabName;
	}

	public void setOperTabName(String operTabName) {
		this.operTabName = operTabName;
	}

	@Column(name = "oper_before_value", length = 65535)
	public String getOperBeforeValue() {
		return this.operBeforeValue;
	}

	public void setOperBeforeValue(String operBeforeValue) {
		this.operBeforeValue = operBeforeValue;
	}

	@Column(name = "oper_after_value", length = 65535)
	public String getOperAfterValue() {
		return this.operAfterValue;
	}

	public void setOperAfterValue(String operAfterValue) {
		this.operAfterValue = operAfterValue;
	}

	public boolean equals(final Object other) {
		if (!(other instanceof TismOperLog))
			return false;
		TismOperLog castOther = (TismOperLog) other;
		return new EqualsBuilder().append(id, castOther.id).append(loginId,
				castOther.loginId).append(loginIp, castOther.loginIp).append(
				macAddr, castOther.macAddr)
				.append(operTime, castOther.operTime).append(operDesc,
						castOther.operDesc).append(action, castOther.action)
				.append(operTabName, castOther.operTabName).append(
						operBeforeValue, castOther.operBeforeValue).append(
						operAfterValue, castOther.operAfterValue).isEquals();
	}

	public int hashCode() {
		return new HashCodeBuilder().append(id).append(loginId).append(loginIp)
				.append(macAddr).append(operTime).append(operDesc).append(
						action).append(operTabName).append(operBeforeValue)
				.append(operAfterValue).toHashCode();
	}

	public String toString() {
		return new ToStringBuilder(this).append("id", id).append("loginId",
				loginId).append("loginIp", loginIp).append("macAddr", macAddr)
				.append("operTime", operTime).append("operDesc", operDesc)
				.append("action", action).append("operTabName", operTabName)
				.append("operBeforeValue", operBeforeValue).append(
						"operAfterValue", operAfterValue).toString();
	}

}
